<?php

include "../../../lib/start.php";

check_session();
check_permission(DOC_PERM);

$id_alunno = $_REQUEST['alunno'];
$id_registro = $_REQUEST['registro'];

header("Content-type: text/plain");
$upd_assenza = "UPDATE reg_alunni SET giustificata = 1 WHERE id_alunno = $id_alunno AND id_registro = $id_registro";
try{
	$db->executeUpdate($upd_assenza);
} catch (MySQLException $ex){
	print "ko#".$ex->getQuery()."#".$ex->getMessage();
	exit;
}

print "ok";
exit;

?>